

//常规判断
function conventionalJudgment(aStr,bStr){
  if(aStr){
    if(bStr){
      return "both"
    }else{
      return "onlyOne"
    }
  }else{
    return "none"
  }
}
console.log(conventionalJudgment("Atest", "Btest")) //both
console.log(conventionalJudgment("Atest"))  //onlyOne
console.log(conventionalJudgment())  //none

//嵌套三目运算实现常规判断
function nestedTernaryOperations(aStr,bStr){
  return aStr ? bStr ? "both" : "onlyOne" : "none"
}
console.log(nestedTernaryOperations("Atest", "Btest")) //both
console.log(nestedTernaryOperations("Atest"))  //onlyOne
console.log(nestedTernaryOperations())  //none